<?php

class ProductsController extends Controller {

	function view($id = null,$name = null) {

		$this->set('title',$name.' - Products Manager');
		$this->set('todo',$this->Product->select($id));
	}

	function viewall() {

		$this->set('title','All products');
		$this->set('todo',$this->Product->selectAll());
	}

	function add() {
		$todo = $_POST['todo'];
		$this->set('title','Success - Products Manager');
		//$this->set('todo',$this->Product->query('insert into items (item_name) values (\''.mysql_real_escape_string($todo).'\')'));
	}

	function delete($id = null) {
		$this->set('title','Success - Products Manager');
		//$this->set('todo',$this->Product->query('delete from items where id = \''.mysql_real_escape_string($id).'\''));
	}

}